package cn.myframe.service.sys;

import cn.myframe.entity.sys.SysUserEntity;
import cn.myframe.service.BaseService;

import java.util.Collection;
import java.util.List;

/**
 *
 */
public interface SysUserService extends BaseService<SysUserEntity>{
	
	/**
	 * 查询用户的所有权限
	 * @param userId  用户ID
	 */
	List<String> queryAllPerms(Long userId);
	
	/**
	 * 查询用户的所有菜单ID
	 */
	List<Long> queryAllMenuId(Long userId);

	List<Long> queryUserByCompanyNo(Long companyNo);
	
    /**
     * 按名字查询用户
     * @param name
     * @return
     */
    SysUserEntity queryByName(String name);

	void save(SysUserEntity user);

	void update(SysUserEntity user);

    void deleteByIds(Long[] ids);

    List<Long> selectIdsByCompanyIds(Collection<Long> relCompanyIds);

    int checkRepeat(String username, String userId);

	int updatePassword(Long userId, String password, String newPassword);

	List<Long> queryDataUser(Long userId, String perms, Long companyNo);
	
	/**
	 * 查询运营商下级运营商的所有用户
	 * @param companyNo
	 * @return
	 */
	List<Long> queryUserBySonCompany(Long companyNo);

	int updateLanguage(Long userId, String language);
	
}
